home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 7.3 KB | 350 lines | [TEXT/MPS ] |
- ;
- ; File: SoundInput.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__SOUNDINPUT__') = 'UNDEFINED' THEN
- __SOUNDINPUT__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
- include 'Dialogs.a'
- ENDIF
- ; include 'Errors.a' ;
- ; include 'Memory.a' ;
- ; include 'MixedMode.a' ;
- ; include 'Windows.a' ;
- ; include 'Quickdraw.a' ;
- ; include 'QuickdrawText.a' ;
- ; include 'Events.a' ;
- ; include 'OSUtils.a' ;
- ; include 'Controls.a' ;
- ; include 'Menus.a' ;
- ; include 'TextEdit.a' ;
-
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
-
- IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
- include 'Sound.a'
- ENDIF
-
- siDeviceIsConnected EQU 1 ;input device is connected and ready for input
- siDeviceNotConnected EQU 0 ;input device is not connected
- siDontKnowIfConnected EQU -1 ;can't tell if input device is connected
- siReadPermission EQU 0 ;permission passed to SPBOpenDevice
- siWritePermission EQU 1 ;permission passed to SPBOpenDevice
-
- ;Info Selectors for Sound Input Drivers
- siDeviceConnected EQU 'dcon' ;input device connection status
- siAGCOnOff EQU 'agc ' ;automatic gain control state
- siPlayThruOnOff EQU 'plth' ;playthrough state
- siTwosComplementOnOff EQU 'twos' ;two's complement state
- siLevelMeterOnOff EQU 'lmet' ;level meter state
- siRecordingQuality EQU 'qual' ;recording quality
- siVoxRecordInfo EQU 'voxr' ;VOX record parameters
- siVoxStopInfo EQU 'voxs' ;VOX stop parameters
- siNumberChannels EQU 'chan' ;current number of channels
- siSampleSize EQU 'ssiz' ;current sample size
- siSampleRate EQU 'srat' ;current sample rate
- siCompressionType EQU 'comp' ;current compression type
- siCompressionFactor EQU 'cmfa' ;current compression factor
- siCompressionHeader EQU 'cmhd' ;return compression header
- siDeviceName EQU 'name' ;input device name
- siDeviceIcon EQU 'icon' ;input device icon
- siDeviceBufferInfo EQU 'dbin' ;size of interrupt buffer
- siSampleSizeAvailable EQU 'ssav' ;sample sizes available
- siSampleRateAvailable EQU 'srav' ;sample rates available
- siCompressionAvailable EQU 'cmav' ;compression types available
- siChannelAvailable EQU 'chav' ;number of channels available
- siAsync EQU 'asyn' ;asynchronous capability
- siOptionsDialog EQU 'optd' ;display options dialog
- siContinuous EQU 'cont' ;continous recording
- siActiveChannels EQU 'chac' ;active channels
- siActiveLevels EQU 'lmac' ;active meter levels
- siInputSource EQU 'sour' ;input source selector
- siInputSourceNames EQU 'snam' ;input source names
- siInputGain EQU 'gain' ;input gain
- siInitializeDriver EQU 'init' ;reserved for internal use only
- siCloseDriver EQU 'clos' ;reserved for internal use only
- siPauseRecording EQU 'paus' ;reserved for internal use only
- siUserInterruptProc EQU 'user' ;reserved for internal use only
- ;Qualities
- siBestQuality EQU 'best'
- siBetterQuality EQU 'betr'
- siGoodQuality EQU 'good'
-
- ;user procedures called by sound input routines
- SPB RECORD 0
- inRefNum ds.l 1 ;reference number of sound input device
- count ds.l 1 ;number of bytes to record
- milliseconds ds.l 1 ;number of milliseconds to record
- bufferLength ds.l 1 ;length of buffer in bytes
- bufferPtr ds.l 1 ;buffer to store sound data in
- completionRoutine ds.l 1 ;completion routine
- interruptRoutine ds.l 1 ;interrupt routine
- userLong ds.l 1 ;user-defined field
- error ds.w 1 ;error
- unused1 ds.l 1 ;reserved - must be zero
- sizeof EQU 38
- ENDR
-
- IF GENERATING68K THEN
- Macro
- _SPBVersion
- dc.w $203C
- dc.w $0000
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBVersion
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SndRecord
- dc.w $203C
- dc.w $0804
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SndRecord
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SndRecordToFile
- dc.w $203C
- dc.w $0708
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SndRecordToFile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBSignInDevice
- dc.w $203C
- dc.w $030C
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBSignInDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBSignOutDevice
- dc.w $203C
- dc.w $0110
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBSignOutDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBGetIndexedDevice
- dc.w $203C
- dc.w $0514
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBGetIndexedDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBOpenDevice
- dc.w $203C
- dc.w $0518
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBOpenDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBCloseDevice
- dc.w $203C
- dc.w $021C
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBCloseDevice
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBRecord
- dc.w $203C
- dc.w $0320
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBRecord
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBRecordToFile
- dc.w $203C
- dc.w $0424
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBRecordToFile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBPauseRecording
- dc.w $203C
- dc.w $0228
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBPauseRecording
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBResumeRecording
- dc.w $203C
- dc.w $022C
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBResumeRecording
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBStopRecording
- dc.w $203C
- dc.w $0230
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBStopRecording
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBGetRecordingStatus
- dc.w $203C
- dc.w $0E34
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBGetRecordingStatus
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBGetDeviceInfo
- dc.w $203C
- dc.w $0638
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBGetDeviceInfo
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBSetDeviceInfo
- dc.w $203C
- dc.w $063C
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBSetDeviceInfo
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBMillisecondsToBytes
- dc.w $203C
- dc.w $0440
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBMillisecondsToBytes
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SPBBytesToMilliseconds
- dc.w $203C
- dc.w $0444
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SPBBytesToMilliseconds
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetupSndHeader
- dc.w $203C
- dc.w $0D48
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SetupSndHeader
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetupAIFFHeader
- dc.w $203C
- dc.w $0B4C
- dc.w $0014
- dc.w $A800
- EndM
- ELSE
- IMPORT SetupAIFFHeader
- ENDIF
-
- ENDIF ; __SOUNDINPUT__
-